package casa.depesos.app.com.activity;

import android.os.Bundle;

import androidx.annotation.Nullable;

import casa.depesos.app.com.R;
import casa.depesos.app.com.databinding.ActivityChangePwdBinding;
import casa.depesos.app.com.frag.ChangePwdFragment;
import casa.depesos.app.com.frag.ForgetCodeFragment;
import casa.depesos.app.com.frag.ForgetPhoneFragment;
import casa.depesos.app.com.frag.NewPwdFragment;

public class ChangePwdActivity extends BaseActivity {

    ActivityChangePwdBinding binding;

    @Override
    protected boolean needPadding() {
        return false;
    }

    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        binding = ActivityChangePwdBinding.inflate(getLayoutInflater());
        setContentView(binding.getRoot());
        replaceFragment(R.id.frame, new ChangePwdFragment());
    }

    public void toForget() {
        ForgetPhoneFragment fragment = new ForgetPhoneFragment();
        replaceFragment(R.id.frame, fragment);
    }

    public void toForgetCode(String phone, boolean hasRight) {
        ForgetCodeFragment fragment = new ForgetCodeFragment();
        fragment.setParam(phone, hasRight);
        replaceFragment(R.id.frame, fragment);
    }

    public void toNewPwd(String phone, String code, int type) {
        replaceFragment(R.id.frame, new NewPwdFragment().setParam(phone, code, 1));
    }
}
